﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities.Presentation.PropertyEditing;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;

namespace WFDataBaseProject.Helpers
{
    public class HierarchyEditor : DialogPropertyValueEditor
    {
        public HierarchyEditor()
        {
            this.InlineEditorTemplate = new DataTemplate();

            FrameworkElementFactory stack = new FrameworkElementFactory(typeof(StackPanel));
            FrameworkElementFactory combobox = new FrameworkElementFactory(typeof(ComboBox));
            Binding comboBinding = new Binding("Value");
            combobox.SetValue(ComboBox.ItemsSourceProperty, comboBinding);
            stack.AppendChild(combobox);
            FrameworkElementFactory txtHierarchy = new FrameworkElementFactory(typeof(TextBox));
            Binding textBinding = new Binding("Value");
            txtHierarchy.SetValue(TextBox.TextProperty, textBinding);
            txtHierarchy.SetValue(TextBox.IsEnabledProperty, false);

            stack.AppendChild(txtHierarchy);

            this.InlineEditorTemplate.VisualTree = stack;

        }
    }
}
